<template>
  <div class="data-dialog">
    <el-dialog
      :title="title"
      :visible.sync="dialogVisible"
      :close-on-click-modal="false"
      width="1000px"
    ></el-dialog>
  </div>
</template>

<script lang="ts">
import { Component, Vue, Prop, Watch } from "vue-property-decorator";

@Component
export default class IdiomDialog extends Vue {
  @Prop(String) title: any;

  dialogVisible: boolean = false;

  @Watch("dialogVisible") dialogChange(val: boolean) {
    if (val) {
      switch (this.title) {
        case "新增配置":
          console.log(1);
          break;
        case "配置修改":
          console.log(2);
          break;
        case "拷贝配置":
          console.log(3);
          break;
        default:
          break;
      }
    }
  }

  created() {
    console.log(this.title);
  }
}
</script>

<style scoped>
</style>